﻿using Huirui.Cavan.Domain.MainBoundedContext.SearchModule;
using Huirui.Cavan.Domain.MainBoundedContext.SystemModule;
using Huirui.Cavan.Presentation.Seedwork;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Huirui.Cavan.Presentation.ViewModel.SystemModule
{
    public class SysActionViewModel : EntityModel<SysAction, int, SysActionSearch>, ISysActionViewModel
    {
        public List<SelectListItem> AuthorizeEmployees { get; set; }
        public bool OnlyQuerySelfData { get; set; }
        public bool CannotQueryPurchaseCostAndAmount { get; set; }
        public bool CannotQuerySalesCostAndAmount { get; set; }
        public int UserAccountID { get; set; }
        public string PermissionActions { get; set; }

        public SysActionViewModel()
        {
            AuthorizeEmployees = new List<SelectListItem>();
        }
    }

    public class RoleActionJson
    {
        public int UserAccountId { get; set; }
        public int RoleId { get; set; }
        public string ModuleName { get; set; }
        public string ActionPart1 { get; set; }
        public string ActionPart2 { get; set; }
        public bool HasPermission { get; set; }
        public int ActionID { get; set; }
        public string IncludeAction { get; set; }
        public int ControllerID { get; set; }
    }

    public class RoleActionJsonViewModel : JsonViewModel<RoleActionJson>
    {
        public bool OnlyQuerySelfData { get; set; }
        public bool CannotQueryPurchaseCostAndAmount { get; set; }
        public bool CannotQuerySalesCostAndAmount { get; set; }
    }
}
